import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "Layout",
    component: () => import("@/layout/Layout"),
    redirect: "/home",
    children: [
      {
        path: "home",
        name: "Home",
        component: () => import("@/views/Home"),
      },
      {
        path: "user",
        name: "User",
        component: () => import("@/views/User"),
      },
      {
        path: "fruitList",
        name: "FruitList",
        component: () => import("@/views/FruitList"),
      },
      {
        path: "testBar",
        name: "TestBar",
        component: () => import("@/views/TestBar"),
      },
      {
        path: "testPie",
        name: "TestPie",
        component: () => import("@/views/TestPie"),
      },
      {
        path: "testLine",
        name: "TestLine",
        component: () => import("@/views/TestLine"),
      },
      {
        path: "fruitBar",
        name: "FruitBar",
        component: () => import("@/views/FruitBar"),
      },
      {
        path: "fruitLine",
        name: "FruitLine",
        component: () => import("@/views/FruitLine"),
      },
      {
        path: "fruitPie",
        name: "FruitPie",
        component: () => import("@/views/FruitPie"),
      },
      {
        path: "person",
        name: "Person",
        component: () => import("@/views/Person"),
      },
      {
        path: "password",
        name: "Password",
        component: () => import("@/views/Password"),
      },
    ],
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/Login"),
  },
  {
    path: "/register",
    name: "Register",
    component: () => import("@/views/Register"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
